/*
 * @Author: caojia
 * @Date: 2023-11-07 11:45:09
 * @LastEditTime: 2023-11-07 17:28:07
 * @LastEditors: caojia
 * @Description: file content
 * @FilePath: \vue2-webfront\vue.config.js
 * 可以输入预定的版权声明、个性签名、空行等
 */
const { defineConfig } = require('@vue/cli-service');
const path = require('path');

function resolve (dir) {
    return path.join(__dirname, dir);
}
module.exports = defineConfig({
    transpileDependencies: true,
    chainWebpack: (config) => {
        config.resolve.alias.set('@', resolve('src')); // 配置别名
        // config.entry('main').add('babel-polyfill') //配置ie
    },
    pluginOptions: {
        'style-resources-loader': {
            preProcessor: 'less',
            patterns: [
                // 全局变量路径
                path.resolve(__dirname, './src/themes/default.less'),
                path.resolve(__dirname, './src/themes/red.less')
            ]
        }
    },
    css: {
        // css预设器配置项
        loaderOptions: {
            less: {
                javascriptEnabled: true
            }
        }
    }
});
